/* 
  1.导入NavigationContainer导航功能组件
  2.创建堆栈导航器
 */
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { Text } from 'react-native';

// 创建堆栈导航器
const Stack = createNativeStackNavigator();

export default function App() {
  return (
    // 配置路由结构
    <NavigationContainer>
      <Stack.Navigator initialRouteName="Home">
        {/* 注册路由 - 首页 */}
        <Stack.Screen name="Home" component={HomeScreen}></Stack.Screen>
        {/* 注册路由 - 详情页 */}
        <Stack.Screen name="Details" component={DetailsScreen}></Stack.Screen>
      </Stack.Navigator>
    </NavigationContainer>
  );
}

// 首页组件
const HomeScreen = () => {
  return <Text>我是HomeScreen</Text>;
};
// 详情页组件
const DetailsScreen = () => {
  return <Text>我是DetailsScreen</Text>;
};
